package command;

import domain.User;


public class UpdateUserForm {
	private String docNumber;
	private String name;
	private String lastName;
	private String email;
	//private MultipartFile image;
	
	public UpdateUserForm(){
	}
	
	public UpdateUserForm(User user){
		this.docNumber=user.getDocNumber();
		this.email=user.getEmail();
		this.lastName=user.getLastName();
		this.name=user.getName();
	}
	
	public void update(User user){
		//FIXME
//		if (!this.image.isEmpty()){
//			try {
//				user.getProfile().setPhoto(new Image(this.image.getBytes()));
//			} catch (IOException e) {
//				throw new RuntimeException("Error al leer el archivo de la imagen en el converter");
//			}			
//		}
		user.setEmail(email);
		user.setLastName(lastName);
		user.setName(name);
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}

	public void setDocNumber(String docNumber) {
		this.docNumber = docNumber;
	}

	public String getDocNumber() {
		return docNumber;
	}
}
